﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace 雷赛板卡上位机.Converter
{
    public class HalfHeightConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is double height)
                if(height > 500)
                {
                    return (height) - (height / 16) - 28;

                }else if(height < 250)
                {
                    return (height) - (height / 8) - 28;
                }
                else
                {
                    return (height) - (height / 10) - 28;
                }
            return 0;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
            => throw new NotImplementedException();
    }
}
